package com.ssyt.ssh.sys.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.ssyt.ssh.common.BaseDao;
import com.ssyt.ssh.sys.dao.DiscussDao;
import com.ssyt.ssh.sys.entity.Discuss;

@Repository
public class DiscussDaoImpl extends BaseDao<Discuss, Integer> implements DiscussDao{

	@Override
	public List<Discuss> listDiscuss() {
		String str = "SELECT * FROM discuss";
		return listEntityBySql(str);
	}

	@Override
	public List<Discuss> listOneDisscuss() {
		String str = "SELECT u.code AS userName,d.id,d.content,d.create_time,d.article_id,d.user_id FROM discuss d,user u WHERE d.user_id=u.id";
		return listEntityBySql(str);
	}

}
